JavaScript

windowObject.setPosition Method

Syntax

windowObj.setPosition(position);

windowObj.setPosition(position, dockLocation);

windowObj.setPosition(relativePosition, ele);

windowObj.setPosition(yPosition, xPosition);

Arguments

positionstring

Can be one of the following values:

Position
Description
"centered"

Positions the window in the center of the viewport.

"dock"

Docks the window to a position specified by dockLocation. If position is "dock", you must define the dockLocation.

dockLocationstring

Defines the docked position. Only required if the first parameter, position is defined to be "dock". dockLocation can be one of the following values:

Dock Location
Description
"top"

Window will be docked at the top of the screen.

"bottom"

Window will be docked at the bottom of the screen.

"left"

Window will be docked on the left of the screen.

"right"

Window will be docked on the right of the screen.

relativePositionstring

If specified, you must pass in a pointer to the 'parent' control, an element in the DOM, as the second parameter (ele) . relativePosition can be one of the following values:

Relative Position
Description
"dropdown"

Window is positioned below the 'parent' control. The left edge of the window is aligned with the left edge of the 'parent' control.

"dropdown-right"

Same as 'dropdown' option except that the window's right edge is aligned with the right edge of the 'parent' control.

"flyout"

Window is positioned to the right of the 'parent' control. The top of the window is aligned with the top of the 'parent' control.

"flyout-bottom"

Window is positioned to the right of the 'parent' control. The bottom of the window is aligned with the bottom of the 'parent' control.

"popup"

Window is positioned over the 'parent' control. The top of the window is aligned with the top of the 'parent' control.

"popup-bottom"

Window is positioned over the 'parent' control. The bottom of the window is aligned with the bottom of the 'parent' control.

eleobject

Required if a relativePosition is defined. A pointer to the 'parent' element that the window is positioned relative to.

yPositionstring

Defines the absolute y position of the window relative to the top edge of the screen. Can be a numeric value defining the number of pixels or a string with a CSS units, eg: "100px", "2in", "10%".

xPositionstring

Required if yPosition has been defined. Defines the absolute x position of the window relative to the left edge of the screen. Can be a numeric value defining the number of pixels or a string with a CSS units, eg: "100px", "2in", "10%".

Description

Defines where the window should be positioned on screen when shown.

Example

//get a pointer to the window object
var windowObj = {dialog.Object}.getWindow('MYWINDOW');

if (windowObj) {
    windowObj.show();

    // position window centered on the screen
    windowObj.setPosition('center');

    // position the window absolutely at y = 24px and x = 32px
    windowObj.setPosition(24, 32);

    // position the window absolutely in inches
    windowObj.setPosition('1in','2in');

    // popup the window relative to another control
    var ele = {dialog.object}.getPointer('MY_BUTTON1');
    windowObj.setPosition('popup',ele);

    // position the window docked on the right side of the screen
    windowObj.setPosition('dock', 'right');
}